home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\SCRIPT\RECURSIO < prev    next >
Text File  |  1994-12-28  |  2KB  |  92 lines

  1. # This one from Daemon (frechett@spot.Colorado.EDU)
  2. # He also threw together the patch to allow this sort of thing.
  3.  
  4. # For use with the recursion abilities of ircII2.2pre5+2 
  5. # set MAX_RECURSIONS however high you want and still think is safe for you.
  6. # Or use it as a limit to the number of times an alias will execute.  It will
  7. # die with an error though.
  8.  
  9. # /iterate command_word list_of_words
  10. # will execute the command for each word in order
  11. ^alias iterate
  12. {
  13.     if ([$1]) {$0 $1;iterate $0 $2-}
  14. }
  15.  
  16. # /conbunch server1 server2 server3
  17. ^alias conbunch
  18. {
  19.     if ( [$1] ) 
  20.         { conbunch $1- }
  21.     connect $0
  22. }
  23.  
  24. # /kickbunch nick1 nick2 nick3 nick4
  25. ^alias kickbunch
  26. {
  27.     if ( [$1] )
  28.         { kickbunch $1-}
  29.     kick $C $0
  30. }
  31.  
  32. # you get the point
  33. ^alias squitbunch
  34. {
  35.     if ( [$1] )
  36.         { squitbunch $1- }
  37.     squit $0
  38. }
  39.  
  40. ^alias versbunch
  41. {
  42.     if ( [$1] )
  43.         { versbunch $1- }
  44.     version $0
  45. }
  46.  
  47. # /opalot + nick1 nick2 nick3     or /opalot - nick1 nick2 nick3  for op or deop
  48. # It will op in an efficient fashion as well.
  49. ^alias opalot
  50. {
  51.     if ( [$4] )
  52.         { opalot $0 $4- }
  53.     mode $C $0ooo $1-3
  54. }
  55.  
  56. # /addlist <listname> word1 word2 word3           add to array
  57. ^alias addlist
  58. {
  59.     if ( [$2] )
  60.         { addlist $0 $2- }
  61.     assign $0.$%strip(#+\.-\*/\={}[]<>!@$$%^~`,?:|'\" $1) $1
  62. }
  63.  
  64. # not related to recursion directly but useful for dealing with arrays.
  65. # /do <list name> <action for element>
  66. ^alias do foreach $0 ii \{ $1- $$($0[$$ii]) \}
  67.  
  68. # /clean <structure name>
  69. # removes all assignments under that name to a single level
  70. ^alias clean foreach $0 ii { assign -$0[$ii] }
  71.  
  72. # /purge <structure name>
  73. # removes all assignments under that name recursively.
  74. ^alias purge {
  75.   foreach $0 ii
  76.   {
  77.     purge $0.$ii
  78.   }
  79.   ^assign -ii
  80.   ^assign -$0
  81. }
  82.  
  83. # Assuming  you've made a list with addlist of servers.. or people or whatever
  84. # the following alias should give you some idea of other things to do..
  85. ^alias versall do $0 version
  86.  
  87. # Yes.. it looks cryptic.. Try /addlist servers h.ece* ucsu* *.unm.edu
  88. # and then /versall servers
  89. # or maybe just type /do servers version         ;)
  90.  
  91. # so much more.. so little time.. 
  92.